﻿<vsx.ui:DialogWindow x:Class="Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.UI.CodeAnalysisConfigurationEditorWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:vsx.ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0"
                     xmlns:local.ui="clr-namespace:Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.UI"
                     x:Name="this"
                     Title="Code Analysis Configuration Editor"
                     WindowStartupLocation="CenterOwner"
                     MinHeight="500" Height="500" MinWidth="450" Width="450">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <CheckBox Name="enableCheckBox" Grid.Row="0" IsChecked="{Binding EnableCodeAnalysis}">Enable Code Analysis</CheckBox>
        <Expander Grid.Row="1" Header="General" IsExpanded="True" Margin="5">
            <Grid IsEnabled="{Binding EnableCodeAnalysis}" Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <CheckBox Grid.Row="0" IsChecked="{Binding OverrideEnableSearchGac}" Margin="5">Override 'Search Global Assembly Cache for missing references'</CheckBox>
                <CheckBox Grid.Row="1" IsChecked="{Binding EnableSearchGac}" IsEnabled="{Binding OverrideEnableSearchGac}" Margin="20,0,0,5">Search Global Assembly Cache for missing references</CheckBox>
                <CheckBox Grid.Row="2" IsChecked="{Binding OverrideIgnoreGeneratedCode}" Margin="5">Override 'Suppress analysis results against generated code'</CheckBox>
                <CheckBox Grid.Row="3" IsChecked="{Binding IgnoreGeneratedCode}" IsEnabled="{Binding OverrideIgnoreGeneratedCode}" Margin="20,0,0,5">Suppress analysis results against generated code</CheckBox>
                <CheckBox Grid.Row="4" IsChecked="{Binding OverrideTimeout}"  Margin="5,10,5,0">Override 'Timeout for analysis deadlock detection'</CheckBox>
                <Label Grid.Row="5" Margin="20,0,0,0">Timeout for analysis deadlock detection</Label>
                <StackPanel Grid.Row="6" Orientation="Horizontal" IsEnabled="{Binding OverrideTimeout}" Margin="20,0,0,0">
                    <Slider Minimum="{Binding MinimumTimeout}" Maximum="{Binding MaximumTimeout}" Value="{Binding Timeout}" TickFrequency="30" TickPlacement="TopLeft" Width="250"/>
                    <Label Content="{Binding Timeout}" Margin="5,0"/>
                </StackPanel>
                <CheckBox Grid.Row="7" IsChecked="{Binding OverrideRuleSet}"  Margin="5,10,5,0">Override 'Analyze code with RuleSet'</CheckBox>
                <Label Grid.Row="8" Margin="20,0,0,0">Analyze code with RuleSet</Label>
                <StackPanel Grid.Row="9" Orientation="Horizontal" IsEnabled="{Binding OverrideRuleSet}" Margin="20,0,0,5">
                    <ComboBox ItemsSource="{Binding RuleSets}" DisplayMemberPath="Name" SelectedValuePath="Path" SelectedValue="{Binding RuleSet}" ToolTip="{Binding SelectedItem.Name, RelativeSource={x:Static RelativeSource.Self}}" Width="210"/>
                    <Button Command="{Binding BrowseRuleSetCommand}" Width="60" Margin="5,0">Browse</Button>
                </StackPanel>
            </Grid>
        </Expander>
        <Expander Grid.Row="2" Header="Code Analysis on Build" IsExpanded="True" Margin="5">
            <Grid IsEnabled="{Binding EnableCodeAnalysis}" Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <CheckBox Grid.Row="0" IsChecked="{Binding OverrideEnableCodeAnalysisOnBuild}" IsEnabled="False" Margin="5">Override 'Enable code analysis on build'</CheckBox>
                <CheckBox Grid.Row="1" IsChecked="{Binding EnableCodeAnalysisOnBuild}" IsEnabled="False" Margin="20,0,0,5">Enable code analysis on build</CheckBox>
            </Grid>
        </Expander>
        <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Margin="5" Width="60" Command="{Binding SaveCommand}">Save</Button>
            <Button Margin="5" Width="60" Command="{Binding CancelCommand}">Cancel</Button>
        </StackPanel>
    </Grid>
</vsx.ui:DialogWindow>
